import request from '@/utils/request'
import type { PageParam, ResponseData } from '../commonType'

enum API {
  PAGE_URL = '/t-sale-info/list',
  ADD_URL = '/t-sale-info/add',
  EDIT_URL = '/t-sale-info/update',
  DELETE_URL = '/t-sale-info/delete',
}

export function saleGetPage(data: any) {
  return request.get<any, ResponseData>(API.PAGE_URL, { params: data })
}

export function saleAdd(data: any) {
  return request.post<any, ResponseData>(API.ADD_URL, data)
}

export function saleEdit(data: any) {
  return request.post<any, ResponseData>(API.EDIT_URL, data)
}

export function saleDelete(id: string | number) {
  return request.post<any, ResponseData>(`${API.DELETE_URL}/${id}`)
}
